<?php
/**
 * 登录验证
 */
session_start();
require ('conn.php');
$username=$_POST['username'];
$password=$_POST['password'];
$sel="select * from userinfo where UserName='$username' and PassWord='$password'";
$query=mysqli_query($conn,$sel);
    if (mysqli_num_rows($query)==0){
        echo "<script>alert('用户名或密码错误！');window.location.href='Login.php';</script>";
    }else{
        $_SESSION['username']=$username;
        echo "<script>alert('登陆成功！');window.location.href='index.php';</script>";
    }

